home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / DDPLUS71.ZIP / DDOVR.PAS < prev    next >
Pascal/Delphi Source File  |  1995-05-01  |  28KB  |  938 lines

  1. unit ddovr;
  2. {$O+,F+,V-}
  3.  
  4. interface
  5.  
  6. uses crt;
  7.  
  8. {procedure showhelp;}
  9.  
  10. procedure GetBBSInfo(
  11.  bbstype: word;
  12.  var user_first_name,user_last_name: string;
  13.  var user_access_level: word;
  14.  var bbs_time_left: integer;
  15.  var com_port: byte;
  16.  var baud_rate : Longint;
  17.  var node_num: byte;
  18.  var local: boolean;
  19.  var graphics: byte;
  20.  var color1: boolean;
  21.  var color_chg: boolean;
  22.  var board_name: string;
  23.  var sysop_first_name: string;
  24.  var sysop_last_name: string;
  25.  var maxtime: word;
  26.  var dropfilepath: string;
  27.  var lockbaud: LongInt);
  28.  
  29. procedure MakeInfoStrings(
  30.  bbstype: word;
  31.  var user_first_name,user_last_name: string;
  32.  var user_access_level: word;
  33.  var bbs_time_left: integer;
  34.  var com_port: byte;
  35.  var baud_rate,baud_modem: longint;
  36.  var node_num: byte;
  37.  var local: boolean;
  38.  var graphics: byte;
  39.  var color1: boolean;
  40.  var color_chg: boolean;
  41.  var board_name: string;
  42.  var sysop_first_name: string;
  43.  var sysop_last_name: string;
  44.  var maxtime: word;
  45.  var dropfilepath: string;
  46.  var lockbaud: longint);
  47.  
  48. const
  49.  numddovrstr=11;
  50. type
  51.  ddovrstrptr=^string;
  52.  ddovrstrarray=array[1..numddovrstr] of ddovrstrptr;
  53. var
  54.  ddovrinfo: ddovrstrarray;
  55.  
  56. implementation
  57.  
  58. procedure GetBBSInfo(
  59.  bbstype: word;
  60.  var user_first_name,user_last_name: string;
  61.  var user_access_level: word;
  62.  var bbs_time_left: integer;
  63.  var com_port: byte;
  64.  var baud_rate: LongInt;
  65.  var node_num: byte;
  66.  var local: boolean;
  67.  var graphics: byte;
  68.  var color1: boolean;
  69.  var color_chg: boolean;
  70.  var board_name: string;
  71.  var sysop_first_name: string;
  72.  var sysop_last_name: string;
  73.  var maxtime: word;
  74.  var dropfilepath: string;
  75.  var lockbaud: LongInt);
  76.  
  77. type
  78.  
  79.    char2  = array[1..2] of char;
  80.    char4  = array[1..4] of char;
  81.    char5  = array[1..5] of char;
  82.    char8  = array [1..8] of char;
  83.    char9  = array [1..9] of char;
  84.    char12 = array[1..12] of char;
  85.    char13 = array [1..13] of char;
  86.    char15 = array[1..15] of char;
  87.    char25 = array[1..25] of char;
  88.    single = array [0..3] of byte;
  89.    bitmap = record
  90.      bits : array [0..4] of byte;
  91.    end;
  92.  
  93.    basic_real_type = array[1..4] of char;
  94.  
  95.    {layout of the PCBOARD12.SYS file while doors are open}
  96.  
  97.    pcb_sys_rec12 = record
  98.       display:        char2;          {display on console?  -1 or 0}
  99.       printer:        char2;          {print log?           -1 or 0}
  100.       page_bell:      char2;          {bother sysop?        -1 or 0}
  101.       alarm:          char2;          {caller alarm sound?  -1 or 0}
  102.       sysop_next:     char2;          {force sysop on next? 'N ', 'X ' or '  '}
  103.  
  104.       baud:           array [1..4] of char;       {caller's baud rate}
  105.       name:           char25;         {caller's name}
  106.       xpert:          char;           {pcb/pro's own expert flag}
  107.       nulls:          char;           {pcb/pro's own nulls flag}
  108.       firstname:      array [1..15] of char;      {caller's first name}
  109.       graphics:       char2;       {ansi graphics mode?  '-1',' 0', or '7E'}
  110.       password:       array [1..12] of char;      {caller's password (last 2 chars redef'd}
  111.       usernum:        integer;        {record number in user file}
  112.       time_on:        Basic_real_type;
  113.       time_limit:     Basic_real_type;
  114.       open_time:      Basic_real_type;
  115.       time_logged:    array [1..5] of char;       {time the user logged on in hh:mm}
  116.       conference:     integer;        {active conference when door opened}
  117.       joined:         array[1..9] of integer;
  118.                                       {0 or -1 for conferences joined}
  119.       time_added:     integer;        {highest conference added time in mins}
  120.       down_limit:     array[1..8] of char;
  121.       upload_credit:  integer;        {upload time credit so far that call}
  122.  
  123.       slanguage:      array [1..4] of char;       {language version used, blank, .FRE etc}
  124.       errcheck:       char2;          {error check/correcting modem? -1 or 0}
  125.       nodechat:       char;           {node chat flag prior to exit to DOS}
  126.    end;
  127.  
  128. var
  129.  pcbsys:       pcb_sys_rec12;
  130.  
  131. function wva(a: word): string;
  132. var
  133.  s: string;
  134. begin;
  135.  str(a,s);
  136.  wva:=s;
  137. end;
  138.  
  139. Function In36(Num : word) : String;
  140. const
  141.   Array36 : array[0..35] of Char = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  142. var
  143.   ch:char;
  144. begin
  145.   ch:='1';
  146.   if num in [0..35] then
  147.     ch:=Array36[num+1];
  148.   In36:=ch;
  149. end;
  150.  
  151. function w36(a: word): string;
  152. var
  153.  s: string;
  154. begin;
  155.  case a of
  156.   10..35 : s:=in36(a);
  157.  else
  158.    str(a,s);
  159.  end;
  160.  w36:=s;
  161. end;
  162.  
  163. function stu(s: string): string;
  164. var
  165.  a: integer;
  166. begin;
  167.  for a:=1 to length(s) do s[a]:=upcase(s[a]);
  168.  stu:=s;
  169. end;
  170.  
  171. procedure DDError(s: string);
  172. begin;
  173.  write(^G^G);
  174.  writeln('ERROR: '+s);
  175.  write(^G^G);
  176.  delay(2000);
  177.  halt;
  178. end;
  179.  
  180. function basic_real(breal: basic_real_type): real;
  181. type
  182.  atmp=array[1..6] of char;
  183. var
  184.  dummy: real;
  185.  x: atmp absolute dummy;
  186. begin;
  187.  x[1]:=breal[4];
  188.  x[2]:=#0;
  189.  x[3]:=#0;
  190.  x[4]:=breal[1];
  191.  x[5]:=breal[2];
  192.  x[6]:=breal[3];
  193.  basic_real:=int(dummy);
  194. end;
  195.  
  196. procedure get_pcbsys_file;
  197. var
  198.    fd:  file of pcb_sys_rec12;
  199. begin
  200.  assign(fd,dropfilepath+'PCBOARD.SYS');
  201.  {$i-} reset(fd); {$i+}
  202.  if ioresult <> 0 then begin;
  203.   dderror('Can''t read system file PCBOARD.SYS');
  204.   halt;
  205.  end;
  206.  read(fd,pcbsys);
  207.  close(fd);
  208. end;
  209.  
  210. function pcboard_time_left: byte;
  211. var
  212.  tl: integer;
  213.  time_used: real;
  214.  time_left: real;
  215. begin;
  216.  time_used:=basic_real(pcbsys.open_time)-basic_real(pcbsys.time_on);
  217.  time_left:=basic_Real(pcbsys.time_limit)-(time_used);
  218.  tl:=round(time_left/60);
  219.  if tl>255 then tl:=255;
  220.  pcboard_time_left:=tl;
  221. end;
  222.  
  223. procedure GetPcb14(var fname,lname: string; var comport,graphics,tleft: integer;
  224.                    var baud :longint);
  225. Type
  226.    {layout of the PCBOARD14.SYS file while doors are open}
  227. {
  228.    Offset   Type   Length  Description
  229.    ------  ------  ------  -----------
  230.       0    str        2    Display On/Off ("-1" = On, " 0" = Off)
  231.       2    str        2    Printer On/Off ("-1" = On, " 0" = Off)
  232.       4    str        2    Page Bell On/Off ("-1" = On, " 0" = Off)
  233.       6    str        2    Caller Alarm On/Off ("-1" = On, " 0" = Off)
  234.       8    char       1    Sysop Flag (" ", "N"=sysop next, "X"=exit dos)
  235.       9    str        2    Error Corrected ("-1" = On, " 0" = Off)
  236.      11    char       1    Graphics Mode ('Y'=yes, 'N'=no, '7'=7E1)
  237.      12    char       1    Node Chat Status ('A'=available, 'U'=unavailable)
  238.      13    str        5    DTE Port Speed (PC to Modem speed)
  239.      18    str        5    Connect Speed shown to caller or "Local"
  240.      23    int        2    User's Record Number in the USERS file
  241.      25    str       15    User's First Name (padded to 15 characters)
  242.      40    str       12    User's Password (padded to 12 characters)
  243.      52    int        2    Time User Logged On (in minutes since midnight)
  244.      54    int        2    Time used so far today (negative number of minutes)
  245.      56    str        5    Time User Logged On (in "HH:MM" format)
  246.      61    int        2    Time Allowed On (from PWRD file) (see note 1 below)
  247.      63    int        2    Allowed K-Bytes for Download (see note 2 below)
  248.      65    char       1    Conference Area user was in (if <= 255)
  249.      66    bitmap     5    Conference Areas the user has joined this session
  250.      71    bitmap     5    Conference Areas the user has scanned this session
  251.      76    int        2    Conference Add Time in minutes
  252.      78    int        2    Upload/Sysop CHAT Credit Minutes (see note 3 below)
  253.      80    str        4    Language Extension (see note 4 below)
  254.      84    str       25    User's Full Name (padded to 25 characters)
  255.     109    int        2    Calculated Minutes Remaining (see note 5 below)
  256.     111    char       1    Node Number (or ' ' if no network)
  257. |   112    str        5    Event Time (in "HH:MM" format, "00:00" if no event)
  258. |   117    str        2    Is Event Active ("-1" = On, " 0" = Off) (see note 7)
  259. |   119    str        2    Reserved (was Slide Event, no longer used here)
  260.     121    bsreal     4    Memorized Message Number
  261.     125    char       1    Comm Port Number (0=none, 1-8)
  262.     126    char       1    Reserved for PCBoard
  263. |   127    bitmap     1    See Node 8 below for details
  264.     128    char       1    Use ANSI (1 = Yes, 0 = No)
  265. |   129    int        2    Country Code
  266. |   131    int        2    Code Page
  267. |   133    char       1    YES character
  268. |   134    char       1    NO character
  269. |   135    char       1    Language 0=None, otherwise correspond with PCBML.DAT
  270. |   136    char       3    RESERVED
  271.     139    char       1    Caller Exited to DOS (1 = Yes, 0 = No)
  272. |   140    char       1    RESERVED (was Event Up Coming, no longer used)
  273.     141    char       1    Stop Uploads (1 = Yes, 0 = No)
  274.     142    int        2    Conference Area user was in (up to 65535)
  275.     144    bitmap  varies  High Conference Areas the user has joined (note 6)
  276.    varies  bitmap  varies  High Conference Areas the user has scanned (note 6)
  277. |  variees int        2    Node Number if offset 111 is set to 255, seek to
  278.                            the end of the file, minus 2, to read this value
  279. }
  280.    pcb_sys_rec14 = record
  281.     {1  } display:        char2;          {display on console?  -1 or 0}
  282.     {3  } printer:        char2;          {print log?           -1 or 0}
  283.     {5  } page_bell:      char2;          {bother sysop?        -1 or 0}
  284.     {7  } alarm:          char2;          {caller alarm sound?  -1 or 0}
  285.     {9  } sysop_next:     char;           {force sysop on next? 'N', 'X' or ' '}
  286.  
  287.     case integer of
  288.     1: (
  289.     {10 } errcheck:       char2;          {error check/correcting modem? -1 or 0}
  290.     {12 } graphics:       char;           {ansi graphics mode?   'Y','N','7'}
  291.     {13 } nodechat:       char;           {node chat status 'U' or 'A'}
  292.     {14 } openbps:        char5;          {BPS rate to open modem port at}
  293.     {19 } connectbps:     char5;          {BPS connect rate or 'Local'}
  294.     {24 } usernum:        integer;        {record number in user file}
  295.     {26 } firstname:      char15;         {caller's first name}
  296.     {41 } password:       char12;         {caller's password}
  297.     {53 } time_on:        integer;        {when the user logged on in MINUTES}
  298.     {55 } prev_used:      integer;        {minutes used in prev calls today, <0}
  299.     {57 } time_logged:    char5;          {hh:mm time the user logged on}
  300.     {62 } time_limit:     integer;        {maximum minutes allowed from PWRD}
  301.     {64 } down_limit:     integer;        {daily download limit/1024 from PWRD}
  302.     {66 } curconf:        byte;           {active conference when door opened}
  303.     {67 } joined:         bitmap;         {areas user has been in}
  304.     {72 } ydone:          bitmap;         {areas user has done 'Y' on}
  305.     {77 } time_added:     integer;        {highest conference added time in mins}
  306.     {79 } time_credit:    integer;        {upload/chat time credit in minutes}
  307.     {81 } slanguage:      char4;          {language used, blank, .FRE etc}
  308.     {85 } name:           char25;         {caller's full name}
  309.     {110} sminsleft:      integer;        {minutes left when door opened}
  310.     {112} snodenum:       byte;           {current node number}
  311.     {113} seventtime:     char5;          {hh:mm event time}
  312.     {118} seventactive:   char2;          {event time active? "-1" or "0 "}
  313.     {120} sslide:         char2;          {slide event? "-1" or " 0"}
  314.     {122} smemmsg:        single;         {memorized message number}
  315.     {126} scomport:       char;           {com port number '0','1','2'}
  316.     {127} resv99:         char;           {filler UNDOCUMENTED}
  317.     {128} bitmap:         byte;           {rip is bit $02     }
  318.     {record size: 128}
  319.       );
  320.  
  321.     2: (
  322.       offline_filler:    array[1..119] of char      {filler, spaces}
  323.       );
  324.    end;
  325.  
  326. VAR
  327.    pcbfile  : file;
  328.    pcb14    : pcb_sys_rec14;
  329.    qbbsout  : text;
  330.    filname  : string[8];
  331.    lastname : string[20];
  332.    graph    : integer;
  333.    sys_name,sysopfirst,sysoplast : string[30];
  334.    a,b,i    : integer;
  335.    c        : char;
  336.    s: string;
  337.    Name        : String[25];
  338.    GM          : String[2];
  339.  
  340. Begin
  341.  Assign(PCBFile,dropfilepath+'PCBoard.Sys');
  342.  {$I-}
  343.  Reset(PCBFile);
  344.  {$I+}
  345.  If (IOResult<>0) Then dderror('... Unable to open pcboard.sys file...');
  346.  BlockRead(PCBFile,PCB14,1);
  347.  Close(PCBFile);
  348.  Name:=pcb14.name;
  349.  FName:=pcb14.firstname;
  350.  LName:=Copy(Name,Pos(' ',Name)+1,Length(Name));
  351. { If (Data[23]=' ') Then Data[23]:='.'; }
  352.  s:='';
  353.  s :=s+Pcb14.SComPort;
  354.  Val(s,ComPort,I);
  355.  s:='';
  356.  for a:= 1 to 5 do
  357.    s:=s+Pcb14.openbps[a];
  358.  while s[length(s)]=' ' do delete(s,length(s),1);
  359.  val(s,baud,i);
  360.  If PCB14.connectbps='Local' then
  361.      baud:=0;
  362.  If (baud=0) Then ComPort:=0;
  363.  
  364.  Case Pcb14.graphics of
  365.   'Y': begin
  366.         Graphics:=2;
  367.        end;
  368.   'N': begin
  369.         Graphics:=0;
  370.        end;
  371.   '7': begin
  372.         Graphics:=0;
  373.        end;
  374.  End; {Case}
  375.  If BBStype = 6 then
  376.    If (PCB14.Bitmap And $02 = $02) then
  377.       Graphics := 4;
  378.  TLeft:=pcb14.sminsleft;
  379.  while ((fname[1]=#0) or (fname[1]=#32)) and (length(fname)>1) do delete(fname,1,1);
  380.  while ((fname[length(fname)]=#0) or (fname[length(fname)]=#32)) and (length(fname)>1) do delete(fname,length(fname),1);
  381.  while ((lname[1]=#0) or (lname[1]=#32)) and (length(lname)>1) do delete(lname,1,1);
  382.  while ((lname[length(lname)]=#0) or (lname[length(lname)]=#32)) and (length(lname)>1) do delete(lname,length(lname),1);
  383.  for a:=1 to length(fname) do fname[a]:=upcase(fname[a]);
  384.  for a:=1 to length(lname) do lname[a]:=upcase(lname[a]);
  385. end;
  386.  
  387. procedure load_rbbs16;
  388. var
  389.  fd:    text;
  390.  a,b: integer;
  391.  info_num:byte;
  392.  s,s2: string;
  393. begin
  394.  If BBStype in [3,9] then color1 := true;
  395.  info_num:=node_num;
  396.  If BBStype=9 then info_num:=1;
  397.  assign(fd,dropfilepath+'DORINFO'+w36(info_num)+'.DEF');
  398.  {$i-}
  399.  reset(fd);
  400.  {$i+}
  401.  if ioresult <> 0 then dderror('Can''t open DORINFO'+w36(info_num)+'.DEF');
  402.  local:=false;
  403.  readln(fd,s);
  404.  readln(fd,s);
  405.  readln(fd,s);
  406.  readln(fd,s);
  407.  val(s[4],com_port,a);
  408.  if com_port=0 then local:=true;
  409.  readln(fd,s);
  410.  s2:='';
  411.  s:=stu(s);
  412.  for a:=1 to pos('BAUD',s)-2 do s2:=s2+s[a];
  413.  if s2[1]=' ' then delete(s2,1,1);
  414.  val(s2,baud_rate,a);
  415.  if (stu(s2)='LOCA') or (stu(s2)='LOCAL') then local:=true;
  416.  if baud_rate=0 then local:=true;
  417.  readln(fd,s);
  418.  readln(fd,user_first_name);
  419.  readln(fd,user_last_name);
  420.  readln(fd,s);
  421.  readln(fd,s);
  422.  if s[1]=' ' then delete(s,1,1);
  423.  while s[length(s)]=' ' do delete(s,length(s),1);
  424.  val(s,graphics,a);
  425.  inc(graphics);
  426.  if color1 then inc(graphics);
  427.  readln(fd,s);
  428.  if s[1]=' ' then delete(s,1,1);
  429.  while s[length(s)]=' ' do delete(s,length(s),1);
  430.  val(s,user_access_level,a);
  431.  readln(fd,s);
  432.  if s[1]=' ' then delete(s,1,1);
  433.  while s[length(s)]=' ' do delete(s,length(s),1);
  434.  val(s,bbs_time_left,a);
  435.  close(fd);
  436.  user_first_name:=stu(user_first_name);
  437.  user_last_name:=stu(user_last_name);
  438. end;
  439.  
  440. procedure Load_pcboard14;
  441. var
  442.  tleft,com,graph: integer;
  443.  baud : longint;
  444. begin;
  445.  getpcb14(user_first_name,user_last_name,com,graph,tleft,baud);
  446.  com_port:=com;
  447.  baud_rate:=baud;
  448.  graphics:=graph;
  449.  bbs_time_left:=tleft;
  450.  user_access_level:=50;
  451.  inc(graphics);
  452.  if (baud_rate=0) or (com_port=0) then local:=true else local:=false;
  453. end;
  454.  
  455. procedure load_pcboard;
  456. var
  457.  a: integer;
  458.  b: boolean;
  459.  ton,toff: real;
  460. begin;
  461.  user_access_level:=0;
  462.  local:=false;
  463.  get_pcbsys_file;
  464.  b:=false;
  465.  user_first_name:='';
  466.  user_last_name:='';
  467.  for a:=1 to 25 do if (pcbsys.name[a]=' ') or (pcbsys.name[a]=#0) then b:=true else if b=false then
  468.   user_first_name:=user_first_name+pcbsys.name[a] else user_last_name:=user_last_name+pcbsys.name[a];
  469.  baud_rate:=300;
  470.  if (pcbsys.baud[1]='1') and (pcbsys.baud[2]='2') then baud_rate:=1200;
  471.  if pcbsys.baud[1]='2' then baud_rate:=2400;
  472.  if pcbsys.baud[1]='4' then baud_rate:=4800;
  473.  if pcbsys.baud[1]='9' then baud_rate:=9600;
  474.  if (pcbsys.baud[1]='1') and (pcbsys.baud[2]='9') then baud_rate:=19200;
  475.  if pcbsys.baud[1]='L' then local:=true;
  476.  if pcbsys.graphics[2]='0' then graphics:=1 else graphics:=3;
  477.  bbs_time_left:=pcboard_time_left;
  478.  user_first_name:=stu(user_first_name);
  479.  user_last_name:=stu(user_last_name);
  480. end;
  481.  
  482. procedure load_phnx;
  483. var
  484.  f : text;
  485.  s : string;
  486.  code,i: integer;
  487.  b : boolean;
  488.  a: integer;
  489. begin;
  490.  assign(f,dropfilepath+'info.bbs');
  491.  writeln('Opening file "info.bbs"');
  492.  {$I-}
  493.  reset(f);
  494.  {$I+}
  495.  if ioresult<>0 then dderror('Error in opening "info.bbs"');
  496.  readln(f,s);
  497.  b:=false;
  498.  user_first_name:='';
  499.  user_last_name:='';
  500.  for a:=1 to 25 do if (pcbsys.name[a]=' ') or (pcbsys.name[a]=#0) then b:=true else if b=false then
  501.   user_first_name:=user_first_name+pcbsys.name[a] else user_last_name:=user_last_name+pcbsys.name[a];
  502.  readln(f,s); val(s,i,code); baud_rate:=i;
  503.  readln(f,s); val(s,i,code); com_port:=i;
  504.  readln(f,s); val(s,i,code); user_access_level:=i;
  505.  readln(f,s); s:=stu(s); if s='TRUE' then local:=true else local:=false;
  506.  readln(f,s);
  507.  readln(f,s); val(s,i,code); bbs_time_left:=i;
  508.  readln(f,s);
  509.  if s='TRUE' then graphics:=3 else graphics:=1;
  510.  if s='TRUE' then color_chg:=true else color_chg:=false;
  511.  readln(f,s);
  512.  close(f);
  513. end;
  514.  
  515. procedure load_WWIV;
  516. var
  517.  a: integer;
  518.  b: boolean;
  519.  f : text;
  520.  ss,s : string;
  521.  code,i: integer;
  522.  sint: word;
  523.  
  524. begin;
  525.  assign(f,dropfilepath+'chain.txt');
  526.  writeln('Opening file "Chain.txt"');
  527.  {$I-}
  528.  reset(f);
  529.  {$I+}
  530.  if ioresult<>0 then dderror('Error in opening "Chain.txt"');
  531.  readln(f,s);
  532.  readln(f,s);
  533.  user_first_name:='';
  534.  user_last_name:='';
  535.  b:=false;
  536.  for a:=1 to length(s) do if s[a]=' ' then b:=true else if b then
  537.   user_last_name:=user_last_name+s[a] else user_first_name:=user_first_name+s[a];
  538.  for i:=1 to 9 do begin;
  539.   readln(f,s);
  540.  end;
  541.  val(s,sint,code);
  542.  user_access_level:=sint;
  543.  readln(f,s);
  544.  readln(f,s);
  545.  readln(f,s);
  546.  if s<>'0' then begin graphics:=3;color_chg:=true; end else begin;
  547.   graphics:=1;
  548.   color_chg:=false;
  549.  end;
  550.  readln(f,s);
  551.  if s<>'0' then local:=false else local:=true;
  552.  readln(f,s);
  553.  while (s<>'') and (s[1]=' ') do delete(s,1,1);
  554.  delete(s,length(s)-3,3);
  555.  val(s,sint,code);
  556.  bbs_time_left:=sint div 60;
  557.  readln(f,s);
  558.  readln(f,s);
  559.  readln(f,s);
  560.  readln(f,s);
  561.  val(s,baud_rate,code);
  562.  readln(f,s);
  563.  val(s,sint,code);
  564.  com_port:=sint;
  565.  readln(f,s);
  566.  board_name:=s;
  567.  readln(f,s);
  568.  sysop_first_name:='';
  569.  sysop_last_name:='';
  570.  b:=false;
  571.  for a:=1 to length(s) do if s[a]=' ' then b:=true else if b then
  572.    sysop_last_name:=sysop_last_name+s[a] else sysop_first_name:=sysop_first_name+s[a];
  573.  close(f);
  574. end;
  575.  
  576. procedure load_doorsys;
  577. var
  578.  b: boolean;
  579.  a: integer;
  580.  f: text;
  581.  s: string;
  582. begin;
  583.  writeln('Opening "DOOR.SYS".');
  584.  assign(f,dropfilepath+'DOOR.SYS');
  585.  {$I-}
  586.  reset(F);
  587.  {$I+}
  588.  if ioresult<>0 then dderror('Cannot load DOOR.SYS');
  589.  
  590.  readln(f,s); {Com Port}
  591.  delete(s,1,3);
  592.  delete(s,2,1);
  593.  val(s,com_port,a);
  594.  if com_port=0 then local:=true else local:=false;
  595.  
  596.  readln(f,s); { remote baud rate}
  597.  readln(f,s); {dbits}
  598.  readln(f,s); {node num}
  599.  
  600.  readln(f,s); {actual internal bbs}
  601.  val(s,baud_rate,a);
  602.  readln(f,s); {screen on}
  603.  readln(f,s); {printer}
  604.  readln(f,s); {page bell}
  605.  readln(f,s); {caller bell}
  606.  
  607.  readln(f,s); {user name}
  608.  s:=stu(s);
  609.  b:=false;
  610.  user_first_name:='';
  611.  user_last_name:='';
  612.  for a:=1 to length(s) do if s[a]=' ' then b:=true else if b then
  613.   user_last_name:=user_last_name+upcase(s[a]) else user_first_name:=user_first_name+upcase(s[a]);
  614.  
  615.  readln(f,s); {city,state}
  616.  readln(f,s); {home phone}
  617.  readln(f,s); {work phone}
  618.  readln(f,s); {password}
  619.  
  620.  readln(f,s); {security}
  621.  val(s,user_access_level,a);
  622.  
  623.  readln(f,s); {times on}
  624.  readln(f,s); {last called}
  625.  readln(f,s); {secs left}
  626.  
  627.  readln(f,s); {time left}
  628.  val(s,bbs_time_left,a);
  629.  
  630.  readln(f,s); {graphics code}
  631.  if s='GR' then graphics:=3
  632.  else
  633.  if s='RIP' then graphics:=5
  634.  else graphics:=1;
  635.  
  636.  close(f);
  637. end;
  638.  
  639. procedure load_spitfire;
  640. var
  641.  b: boolean;
  642.  a: integer;
  643.  f: text;
  644.  s: string;
  645. begin;
  646.  writeln('Opening "SFDOORS.DAT".');
  647.  assign(f,dropfilepath+'SFDOORS.DAT');
  648.  {$I-}
  649.  reset(F);
  650.  {$I+}
  651.  if ioresult<>0 then dderror('Cannot load SFDOORS.DAT');
  652.  
  653.  readln(f,s);
  654.  readln(f,s); {name}
  655.  s:=stu(s);
  656.  b:=false;
  657.  user_first_name:='';
  658.  user_last_name:='';
  659.  for a:=1 to length(s) do if s[a]=' ' then b:=true else if b then
  660.   user_last_name:=user_last_name+upcase(s[a]) else user_first_name:=user_first_name+upcase(s[a]);
  661.  
  662.  readln(f,s);
  663.  readln(f,s);
  664.  readln(f,s); {baud}
  665.  val(s,baud_rate,a);
  666.  if baud_rate=0 then local:=true else local:=false;
  667.  
  668.  readln(f,s); {cport}
  669.  val(s,com_port,a);
  670.  if com_port=0 then local:=true else local:=false;
  671.  
  672.  readln(f,s); {time left}
  673.  val(s,bbs_time_left,a);
  674.  
  675.  readln(f,s);
  676.  readln(f,s);
  677.  readln(f,s); {ansi}
  678.  if stu(s)='TRUE' then graphics:=3 else graphics:=1;
  679.  
  680.  readln(f,s); {sec}
  681.  val(s,user_access_level,a);
  682.  
  683.  close(f);
  684. end;
  685.  
  686. procedure Load_2am;
  687. var
  688.  f: text;
  689.  s,s2: string;
  690.  a: integer;
  691. begin;
  692.  local:=false;
  693.  user_access_level:=0;
  694.  writeln('Opening JUMPER.DAT');
  695.  assign(f,dropfilepath+'JUMPER.DAT');
  696.  {$I-}
  697.  reset(F);
  698.  {$I+}
  699.  if ioresult<>0 then dderror('Cannot open JUMPER.DAT');
  700.  readln(f,s);
  701.  readln(f,s);
  702.  readln(f,s);
  703.  readln(f,s);
  704.  
  705.  readln(f,s);
  706.  user_first_name:=s;
  707.  readln(f,s);
  708.  user_last_name:=s;
  709.  
  710.  readln(f,s);
  711.  
  712.  readln(f,s);
  713.  val(s,bbs_time_left,a);
  714.  readln(f,s);
  715.  val(s,com_port,a);
  716.  if com_port=0 then local:=true;
  717.  readln(f,s);
  718.  val(s,baud_rate,a);
  719.  if baud_rate=0 then local:=true;
  720.  
  721.  readln(f,s);
  722.  readln(f,s);
  723.  readln(f,s);
  724.  readln(f,s);
  725.  
  726.  readln(f,s);
  727.  readln(f,s2);
  728.  graphics:=1;
  729.  if (s='TRUE') and (s2='FALSE') then graphics:=2;
  730.  if (s2='TRUE') then graphics:=3;
  731.  close(f);
  732. end;
  733.  
  734. procedure Load_TriBBS;
  735. var
  736.  b: boolean;
  737.  a: integer;
  738.  f: text;
  739.  s,s2: string;
  740. begin;
  741.  local:=false;
  742.  user_access_level:=0;
  743.  writeln('Opening TRIBBS.SYS');
  744.  assign(f,dropfilepath+'TRIBBS.SYS');
  745.  {$I-}
  746.  reset(F);
  747.  {$I+}
  748.  if ioresult<>0 then dderror('Cannot open TRIBBS.SYS');
  749.  readln(f,s);
  750.  readln(f,s); {user name}
  751.  s:=stu(s);
  752.  b:=false;
  753.  user_first_name:='';
  754.  user_last_name:='';
  755.  for a:=1 to length(s) do if s[a]=' ' then b:=true else if b then
  756.   user_last_name:=user_last_name+upcase(s[a]) else user_first_name:=user_first_name+upcase(s[a]);
  757.  readln(f,s);  {password }
  758.  readln(f,s);  {security}
  759.  readln(f,s);  {help lev}
  760.  readln(f,s);  {graphics}
  761.  If s = 'Y' then
  762.   graphics := 3
  763.  else
  764.   graphics := 1;
  765.  
  766.  readln(f,s); {minutes left}
  767.  val(s,bbs_time_left,a);
  768.  
  769.  readln(f,s); {phonenumber}
  770.  readln(f,s); {citystate  }
  771.  readln(f,s); {birthdate  }
  772.  readln(f,s); {nodenumber }
  773.  val(s,node_num,a);
  774.  readln(f,s);  {comportno }
  775.  val(s,com_port,a);
  776.  if com_port=0 then local:=true;
  777.  
  778.  readln(f,s); {modembaud rate }
  779.  val(s,baud_rate,a);
  780.  if baud_rate=0 then local:=true;
  781.  readln(f,s); {baud rate }
  782.  val(s,baud_rate,a);
  783.  lockbaud := baud_rate;
  784.  if baud_rate=0 then local:=true;
  785.  close(f);
  786. end;
  787.  
  788. procedure load_local;
  789. var
  790.  a,b: integer;
  791.  d: boolean;
  792.  s: string;
  793. begin;
  794.  val(paramstr(1),a,b);
  795.  if a>0 then node_num:=a;
  796.  local:=true;
  797.  writeln;
  798.  writeln('┌───────────────────────────────┐');
  799.  writeln('│          Local Logon          │');
  800.  writeln('└───────────────────────────────┘');
  801.  writeln;
  802.  writeln('Please enter your name below (or leave blank for '+sysop_first_name+' '+sysop_last_name+'):');
  803.  write('>');
  804.  readln(s);
  805.  if s='' then begin;
  806.   user_first_name:=stu(sysop_first_name);
  807.   user_last_name:=stu(sysop_last_name);
  808.  end else begin;
  809.   user_first_name:='';
  810.   user_last_name:='';
  811.   d:=false;
  812.   for a:=1 to length(s) do if s[a]=' ' then d:=true else if d=false then
  813.    user_first_name:=user_first_name+upcase(s[a])
  814.   else
  815.    user_last_name:=user_last_name+upcase(s[a]);
  816.   if user_last_name='' then begin;
  817.    writeln('Please enter your last name:');
  818.    write('>');
  819.    readln(user_last_name);
  820.    user_last_name:=stu(user_last_name);
  821.   end;
  822.  end;
  823.  graphics:=3;
  824.  bbs_time_left:=120;
  825.  user_access_level:=255;
  826. end;
  827.  
  828. procedure load_maint;
  829. begin;
  830.  local:=true;
  831.  user_first_name:='SYSTEM';
  832.  user_last_name:='MAINTENANCE';
  833.  bbs_time_left:=120;
  834.  graphics:=3;
  835. end;
  836.  
  837. begin;
  838.  baud_rate:=0;
  839.  if bbstype=0 then load_maint;
  840.  if bbstype=1 then load_local;
  841.  if bbstype=3 then load_rbbs16;
  842.  if bbstype=4 then load_pcboard;
  843.  if bbstype=5 then load_WWIV;
  844.  if bbstype=6 then load_pcboard14;
  845.  if bbstype=7 then load_rbbs16;
  846.  if bbstype=8 then load_phnx;
  847.  if bbstype=9 then load_rbbs16;
  848.  if bbstype=10 then load_pcboard14;
  849.  if bbstype=11 then load_doorsys;
  850.  if bbstype=12 then load_spitfire;
  851.  if bbstype=13 then load_2am;
  852.  if bbstype=14 then load_TriBBS;
  853.  user_first_name:=stu(user_first_name);
  854.  user_last_name:=stu(user_last_name);
  855. {if node_num=0 then node_num:=1; }
  856.  if graphics>=3 then color_chg:=true else color_chg:=false;
  857.  if bbs_time_left>maxtime then bbs_time_left:=maxtime;
  858. end;
  859.  
  860. function wva(w: word): string;
  861. var
  862.  s: string;
  863. begin;
  864.  str(w,s);
  865.  wva:=s;
  866. end;
  867.  
  868. procedure stuffstr(n: word; s: string);
  869. begin;
  870.  getmem(ddovrinfo[n],length(s)+1);
  871.  move(s,ddovrinfo[n]^,length(s)+1);
  872. end;
  873.  
  874. procedure MakeInfoStrings(
  875.  bbstype: word;
  876.  var user_first_name,user_last_name: string;
  877.  var user_access_level: word;
  878.  var bbs_time_left: integer;
  879.  var com_port: byte;
  880.  var baud_rate,baud_modem: longint;
  881.  var node_num: byte;
  882.  var local: boolean;
  883.  var graphics: byte;
  884.  var color1: boolean;
  885.  var color_chg: boolean;
  886.  var board_name: string;
  887.  var sysop_first_name: string;
  888.  var sysop_last_name: string;
  889.  var maxtime: word;
  890.  var dropfilepath: string;
  891.  var lockbaud: longint);
  892.  
  893. const
  894.  software_names: array[0..14] of string[15]=
  895.   ('Maint',     'Local',      'Sysop',      'QBBS',       'PCBoard 12',
  896.    'WWIV',      'PCBoard 15',        'RBBS 16+',   'Phoenix',    'DORINFO1',
  897.    'PCBoard 14','DOORSYS',    'Spitfire',   '2am-bbs',   'TriBBS');
  898.  drop_files: array[0..14] of string[15]=
  899.   ('n/a',        'n/a',         'n/a',         'DORINFOx.DEF',
  900.    'PCBOARD.SYS','CHAIN.TXT','PCBOARD.SYS', 'DORINFOx.DEF',
  901.    'INFO.BBS',   'DORINFO1.DEF','PCBOARD.SYS', 'DOOR.SYS',
  902.    'SFDOORS.DAT','JUMPER.DAT','TRIBBS.SYS');
  903.  istrue: array[false..true] of string[8] = ('FALSE','TRUE');
  904. var
  905.  s: string;
  906.  a: integer;
  907. begin;
  908.  stuffstr( 1,'Baud rate: '+wva(baud_rate));
  909.  stuffstr( 2,'    Local: '+istrue[local]);
  910.  stuffstr( 3,' Graphics: '+wva(graphics));
  911.  stuffstr( 4,'Time left: '+wva(bbs_time_left));
  912.  stuffstr( 5,' Com Port: '+wva(com_port));
  913.  stuffstr( 6,'     User: '+user_first_name+' '+user_last_name);
  914.  stuffstr( 7,'Access lv: '+wva(user_access_level));
  915.  stuffstr( 8,' Node num: '+wva(node_num));
  916.  if lockbaud=0 then s:='Not Locked' else s:=wva(lockbaud);
  917.  stuffstr( 9,'Lock Baud: '+s);
  918.  stuffstr( 10,' Software: '+software_names[bbstype]);
  919.  s:=drop_files[bbstype];
  920.  for a:=1 to length(s) do if s[a]='x' then s[a]:=chr(node_num+ord('0'));
  921.  stuffstr(11,'Drop file: '+s);
  922.  stuffstr(12,'Drop Path: '+dropfilepath);
  923. end;
  924.  
  925. {
  926.  /E - Use ESM for extra memory');
  927.  /L - Local mode');
  928.  /Bxxx - Specify locked baud rate (i.e. /B38400)');
  929.  /C    - Specify comport number.
  930.  /F    - Specify maintenance type 1.
  931.  /H    - Specify maintenance type 2.
  932.  /Nx   - Specify node number');
  933.  /R    - Force RIP graphics');
  934.  /Pyyy - Specify path to drop file (i.e. /Pc:\bbs');
  935.  
  936.     }
  937.  
  938. end.